import { createApp } from 'vue'

import ElementPlus from 'element-plus';

import * as ElIcons from '@element-plus/icons'
import 'amfe-flexible/index.js'

import 'element-plus/dist/index.css'
import '@/style/common.scss'
// 引入路由配置
import router from './router/index'
import App from './App.vue'

import * as echarts from 'echarts';

import './mock'
import './permission'
// 引入文件
import store from './store/index'


const app = createApp(App)
// console.log(ElIcons)
// for (const name in ElIcons){
// 	app.component(name,(ElIcon as any)[name])
// }
app.use(ElementPlus)
// app.use(ElIcons)

app.config.globalProperties.$echarts = echarts;//全局使用
// 注册
app.use(router)
app.use(store)
app.mount('#app')

Object.keys(ElIcons).forEach(key => {
    app.component(key, ElIcons[key])
  })
